<?php
namespace Web\Logic;
class IndexLogic {

	/**
	 * 查询数据
	 * @param unknown $data
	 */
	public function selUserInfo($data){
		try {
			//实例化模块
			$mod = M('member');
			$rdata = $mod->alias('m')
			             ->field("m.userid,m.username,m.isforbidden,r.menuroot,r.function_id,e.rolename,e.isforbidden as eisforbidden,r.menuroot,m.roleid")
			             ->join("left join ".C('DB_PREFIX')."role as e on m.roleid = e.roleid")
			             ->join("left join ".C('DB_PREFIX')."role_info as r on m.roleid = r.roleid")
			             ->where("m.username = '$data[username]' and m.password = '$data[password]'")
			             ->find();

			return $rdata;
		} catch (Exception $e) {
			return "";
		}
	}
}